﻿namespace Infrastructure.CrossCutting.Messages
{
    //public class BoolMessageItem : BoolMessage
    //{
    //    public new static readonly BoolMessageItem True = new BoolMessageItem(true, string.Empty, null);

    //    public new static readonly BoolMessageItem False = new BoolMessageItem(false, string.Empty, null);

    //    public BoolMessageItem(bool success, string message, object item) : base(success, message)
    //    {
    //        Item = item;
    //    }

    //    public object Item { get; set; }

    //    public BoolMessageItem AddMessages(IList<string> errors)
    //    {
    //        throw new NotImplementedException();
    //    }
    //}

    public class BoolMessageItem<T> : BoolMessage
    {
        public new static readonly BoolMessageItem<T> True = new BoolMessageItem<T>(true, string.Empty, default(T));

        public new static readonly BoolMessageItem<T> False = new BoolMessageItem<T>(false, string.Empty, default(T));

        public BoolMessageItem(bool success, string message, T item) : base(success, message)
        {
            Item = item;
        }

        public T Item { get; private set; }

        public new BoolMessageItem<T> SetMessage(string message)
        {
            Message = message;
            return this;
        }

        public BoolMessageItem<T> SetItem(T item)
        {
            Item = item;
            return this;
        }


    }
}
